package com.test.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;


import com.test.dto.Notice;
import com.test.service.NoticeService;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

@Service
public class NoticeServiceImpl implements NoticeService {

    @Override
    public String sayHello() {
        return "你好－－－dubbo";
    }

    @Override
    public Notice getNotice() {
        System.err.println("getNotice:" + System.currentTimeMillis());
        Notice notice = new Notice();
        notice.setId(1);
        notice.setName("中国好声音");
        notice.setDate(new Date());

        return notice;
    }

    @Override
    public List<Notice> findNoticeList() {
        System.err.println("findNoticeList==1.3:" + System.currentTimeMillis());
        List<Notice> list = new ArrayList<Notice>();
        for (int i = 0; i < 5; i++) {
            Notice notice = new Notice();
            notice.setId(i);
            notice.setName("你好dubbo" + i);
            notice.setDate(new Date());

            list.add(notice);
        }

        return list;
    }

}
